<template>
  <div class="permisList">
    <div class="listDiv">
      <el-table :data="tableData" stripe style="width: 100%" :border="true">
        <el-table-column prop="authName" label="权限名" width="500">
        </el-table-column>
        <el-table-column prop="path" label="权限路径" width="500">
        </el-table-column>
        <el-table-column prop="level" label="权限等级">
          <template slot-scope="scope">
            <el-tag
              :type="
                scope.row.level === '0'
                  ? 'primary'
                  : scope.row.level === '1'
                  ? 'success'
                  : 'danger'
              "
            >
              <span v-if="scope.row.level === '0'">一级</span>
              <span v-if="scope.row.level === '1'">二级</span>
              <span v-if="scope.row.level === '2'">三级</span>
            </el-tag>
          </template>
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>

<script>
import user from "@/api/user";
export default {
  name: "permisList",
  data() {
    return {
      tableData: [],
    };
  },
  mounted() {
    let _this = this;
    user.getListPer().then((res) => {
      _this.tableData = res.data.data;
    });
  },
};
</script>

<style scoped>
.permisList {
  padding: 15px;
  box-sizing: border-box;
}
.listDiv {
  box-shadow: 1px 1px 5px 1px rgba(113, 113, 113, 0.25);
}
</style>